using System;
using System.Collections.Generic;
using SouthernLand.Common.DAL.NhaDat;

namespace SouthernLand.Common.BOL.NhaDat
{
    public class TinhThanh
    {
        #region Public Properties

        public Int32 TinhThanhID { get; set; }

        public String TenTinhThanh { get; set; }

        public String TenTinhThanh_en { get; set; }

        #endregion

        #region public static Methods

        public static string GetTenTinhThanhByID(int ID)
        {
            TinhThanh obj = GetTinhThanhByID(ID);
            return Globals.GetLang(obj.TenTinhThanh, obj.TenTinhThanh_en);
        }

        public static int Insert(TinhThanh obj)
        {
            var db = new TinhThanhDAL();
            return db.Insert(obj);
        }

        public static bool Update(TinhThanh obj)
        {
            var db = new TinhThanhDAL();
            return db.Update(obj);
        }

        public static bool Delete(Int32 TinhThanhID)
        {
            var db = new TinhThanhDAL();
            return db.Delete(TinhThanhID);
        }

        public static TinhThanh GetTinhThanhByID(Int32 TinhThanhID)
        {
            var db = new TinhThanhDAL();
            return db.GetTinhThanhByID(TinhThanhID);
        }

        //Get All TinhThanh
        public static List<TinhThanh> GetAllTinhThanh()
        {
            var db = new TinhThanhDAL();
            return db.GetAllTinhThanh(1, 10000);
        }

        //Get All TinhThanh
        public static List<TinhThanh> GetAllTinhThanh(int PageIndex, int PageSize)
        {
            var db = new TinhThanhDAL();
            return db.GetAllTinhThanh(PageIndex, PageSize);
        }

        // Get Count All records of Table  TinhThanh
        public static int GetCountTinhThanh()
        {
            var db = new TinhThanhDAL();
            return db.GetCountTinhThanh();
        }

        #endregion
    }
}